[WIP] Add wrapper for BLS from Chia Network#72
Closed
mhchia wants to merge 8 commits intoethereum:masterfrom
Closed
[WIP] Add wrapper for BLS from Chia Network#72mhchia wants to merge 8 commits intoethereum:masterfrom
mhchia wants to merge 8 commits intoethereum:masterfrom
Conversation
And fix a bug in `aggregate_signatures`: make sure bytes are converted to `bls_chia.Signature`
Member
Author
|
CI fails due to the lack of CMake, but installing CMake and building result in much more time.(Though it can be mitigated with the cache in circle CI). I'm considering whether |
Member
|
Worth thinking about experimenting w/ the code linked in #73 |
Member
Author
|
Agree! It looks pretty interesting. I think both C and pure Python worth our trying, too. |
Making use of `InsecureSignature.aggregate`
Don't add 1 to the `private_key`. The range of private key should be (0, curve_order - 1].
Member
Author
|
Moved to trinity in ethereum/trinity#708 |
pacrob
pushed a commit
to pacrob/py_ecc
that referenced
this pull request
Oct 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong?
Fixes #71. I will use "BLS chia" as the alias of Chia network's BLS implementation, along with its python bindings in the following paragraphs.
How was it fixed?
sign,privtopub,verify,aggregate_signatures,aggregate_pubkeys,aggregate_multiplewith BLS chia.tests/test_bls.pytotests/test_bls_chia.pyand test with those functions.scripts/benchmark_api.py, which is mostly inspired by Benchmark #69.Problems
1.RuntimeError: Caught an unknown exception!if the source signatures are initialized withblspy.Signature.from_bytes. This issue is really hard to debug since no further information is printed from the C++ side. Currently, I workaround it through adding a_sig_map: Dict[bytes, bls_chia.Signature] = {}, which memoizes all signatures generated throughsignandaggregate_signatures, to avoid the issue resulting fromSignature.from_bytes. Ref: Potential bug in Signature deserialization and aggregation using Python Chia-Network/bls-signatures#54Example benchmark
Run
number=100times withtimeit, with20keys and signatures aggregated. Need to further try the other parameters, and understand the meanings of the result.To make use of the script with custom implementations:
api.pywith functionsprivtopub,verify,aggregate_signatures,aggregate_pubkeys,verify_multiple.api.pyunder a package with your custom name, says "bls_another", underpy_ecc, sopy_ecc/bls_another/api.py.python py_ecc/scripts/benchmark_api.py bls_another.Cute Animal Picture